//package com.wt.admin.service.ai.impl.mcp;
//
//import io.modelcontextprotocol.client.McpClient;
//import io.modelcontextprotocol.spec.McpSchema;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.ai.mcp.customizer.McpSyncClientCustomizer;
//import org.springframework.stereotype.Component;
//
//import java.time.Duration;
//import java.util.List;
//
//@Component
//@Slf4j
//public class CustomMcpSyncClientCustomizer implements McpSyncClientCustomizer {
//    @Override
//    public void customize(String serverConfiurationName, McpClient.SyncSpec spec) {
//
//        // Customize the request configuration
//        spec.requestTimeout(Duration.ofSeconds(10));
//        // 设置此客户端的服务器连接可以访问的根 URI。
//        McpSchema.Root c = new McpSchema.Root("C://","c盘");
//        McpSchema.Root d = new McpSchema.Root("D://","d盘");
//        spec.roots(c,d);
//
//        // Sets a custom sampling handler for processing message creation requests.
//        spec.sampling((McpSchema.CreateMessageRequest messageRequest) -> {
//            log.debug("收到采样请求");
//            // Handle sampling
//            List<McpSchema.SamplingMessage> messages = messageRequest.messages();
//            McpSchema.CreateMessageResult build = McpSchema.CreateMessageResult.builder()
//                    .message("你好")
//                    .build();
//            return build;
//        });
//
//        // Adds a consumer to be notified when the available tools change, such as tools
//        // being added or removed.
//        spec.toolsChangeConsumer((List<McpSchema.Tool> tools) -> {
//            // Handle tools change
//            log.debug("添加工具或删除工具可以收到通知");
//        });
//
//        // Adds a consumer to be notified when the available resources change, such as resources
//        // being added or removed.
//        spec.resourcesChangeConsumer((List<McpSchema.Resource> resources) -> {
//            // Handle resources change
//            log.debug("添加资源或删除资源可以收到通知");
//        });
//
//        // Adds a consumer to be notified when the available prompts change, such as prompts
//        // being added or removed.
//        spec.promptsChangeConsumer((List<McpSchema.Prompt> prompts) -> {
//            log.debug("添加提示或删除提示可以收到通知");
//            // Handle prompts change
//        });
//
//        // Adds a consumer to be notified when logging messages are received from the server.
//        spec.loggingConsumer((McpSchema.LoggingMessageNotification logs) -> {
//            log.debug("收到日志消息");
//            // Handle log messages
//        });
//    }
//}
